<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>注册</title>
    <link rel="stylesheet" href="../lib/css/animate.css">
    <link rel="stylesheet" href="../lib/css/delay.css">
    <link rel="stylesheet" href="../lib/css/frozen.css">
    <link rel="stylesheet" href="../lib/css/font-awesome.css">
    <link rel="stylesheet" href="../communal/css/style-lmh.css"/>
    <link rel="stylesheet" href="../communal/css/style_lcy.css"/>
    <link rel="stylesheet" href="../lib/css/bootstrap.main.css"/>
</head>
<style>
    /*body{*/
        /*background-image: url(../communal/imgs/pojiu.jpg);*/
    /*}*/
</style>
<body>
<!--头部-->
<header class="ui-header ui-header-positive ui-border-b " style="background-color: #29AD7B;">
    <div class="tou1-lmh my-nav">
        <span class="shouye">首页</span>
        <span class="addres active">目的地</span>
        <span class="">酒店</span>
        <span>社区</span>
    </div>
    <div class="tou2-lmh">
            <span>
             <i class="fa fa-user-circle-o" aria-hidden="true"></i> 我的
            </span>
    </div>
</header>
<!--中间.......-->
<section class="ui-container">
        <div class="ui-form  form_lcy">
            <form action="#">
                <div class="ui-form-item ui-form-item-pure  input_text1_lcy form-group">
                    <input style="padding-left: 4vw;" class="form-control username" type="text" placeholder="手机号/邮箱">
                </div>
                <div class="ui-form-item ui-form-item-pure  input_text1_lcy form-group">
                    <input style="padding-left: 4vw;" class="form-control userpass" type="password" placeholder="密码">
                </div>
                <div class="ui-form-item  input_text1_lcy form-group">
                    <!--<i class="fa fa-user-o" aria-hidden="true"></i>-->
                    <input style="padding-left: 4vw;" class="form-control userpass2"  type="password" placeholder="确认密码">
                </div>
                <div class="ui-btn-wrap font_tubiao_lcy" >
                    <button class="ui-btn ui-btn-primary zhuce_submit_lcy">
                        注册
                    </button>
                    <br/>
                    <a href="./login.html">登录</a>
                </div>
            </form>
    </div>
</section>
<script src="../lib/js/zepto.min.v1.1.6.js"></script>
<script src="../lib/js/zepto.toch.js"></script>
<script src="../lib/js/frozen.js"></script>
<script>
    $('.tou1-lmh > span').eq(0).on("tap",function(){
        window.location.href = "./index-lmh.html";
    });
    $('.tou1-lmh > span').eq(1).on("tap",function(){
        window.location.href = "./mudidi-lcy.html";
    });
    $('.tou1-lmh > span').eq(2).on("tap",function(){
        window.location.href = "./Hotel-lmh.html";
    });
    $('.tou1-lmh > span').eq(3).on("tap",function(){
        window.location.href = "../communal/html/chat_Phone.html";
    });
//    注册
    var zhucebut = $(".zhuce_submit_lcy");
    zhucebut.on('touchend',function(){
        var name = $(".username").val(),
            pass = $(".userpass").val(),
            pass2 = $(".userpass2").val();
        console.log(name);
        console.log(pass);
        console.log(pass2);
//        查询user是否存在
        $.ajax({
            type:"post",
            url:"/postseachuser",
            data:{text1:name},
            success:function(data){
                console.log(data);
                if(dat.length == 1){
                    $.ajax({
                        type:"post",
                        url:"/postadduser",
                        data:{text1:name,text2:pass},
                        success:function(data){
                            console.log(data);
                            alert("注册成功");

                        }
                    });
                }else{
                    alert("用户已存在");
                }
            }
        });
//        添加用户
        function adddata(data1,data2){
            $.ajax({
                type:"post",
                url:"/postadduser",
                data:{text1:data1,text2:data2},
                success:function(data){
                    console.log(data);

                }
            });
        }

    });
</script>
</body>
</html>